from tests.pytests.helpers.codegen_helpers import compile_chunk, assert_code_contains


def test_explicit_return():
    def h(x: int) -> int:
        if x > 0:
            return x
        return 0

    block = compile_chunk(h)
    assert_code_contains(
        block,
        """
        int h(int x) {
            if (x > 0) {
                return x;
            }
            return 0;
        }
        """,
    )
